{% extends "openvolunteer/base.html" %}

{% block title %}OpenVolunteer | Édition d'une fiche{% endblock %}

{% block content %}
    <form method="post" action="." class="edit-form center" enctype="multipart/form-data">{% csrf_token %}
        <table class="centered">
            <tr>
                <th>Titre</th>
                <td class="required">
                    <input type="text" id="id_title" name="title"
                           maxlength="100" value='{{ event.title }}'>
                </td>
            </tr>
            <tr>
                <th>Date</th>
                <td class="required">
                    <input type="text" id="id_date_day" maxlength="2" size="2"
                           name="date_day" value='{{ event.date|date:"d" }}'>
                    <input type="text" id="id_date_month" maxlength="2" size="2"
                           name="date_month" value='{{ event.date|date:"m" }}'>
                    <input type="text" id="id_birthday_year" maxlength="4" size="4"
                           name="date_year" value='{{ event.date|date:"Y" }}'>
                </td>
            </tr>
            <tr>
                <th>Lieu</th>
                <td>
                    <input type="text" id="id_place" name="place"
                           maxlength="100" value='{{ event.place }}'>
                </td>
            </tr>
            <tr>
                <th>Affiche</th>
                <td>
                    {{ form.affiche }}<br>
                    <input type="checkbox" id="id_delete_affiche" name="delete_affiche"><i>Supprimer l'affiche actuelle?</i>
                </td>
            </tr>
        </table>
        <p class="required">* Les champs marqués en <span>rouge</span> sont obligatoires.</p>
        <input type="submit" value="Enregistrer">
    </form>
{% endblock %}

{% block navigation %}
    <ul>
        {% if event %}
            <li><a href="{{ event.get_absolute_url }}" title="">Revenir à la fiche de l'événement</a></li>
        {% else %}
            <li><a href="{{ settings.OPENVOLUNTEER_WEB_ROOT }}/event/" title="">Rechercher un événement</a></li>
        {% endif %}
    </ul>
{% endblock %}
